1. Field of the Invention
The present invention relates to a control and management system for a memory card such as an IC (Integrated Circuit) memory card for storing data such as picture data in the memory card and for managing the data stored in the memory card.
2. Description of the Related Art
Recently, there become such a tendency that an IC memory card using a semiconductor memory is used as a storage medium which is adapted to readily store therein image data obtained by image data sources such as digital electronic still cameras and the like as well as character data made up with processor systems such as computers.
As a semiconductor memory used in IC memory cards, it has been scrutinized that an EEPROM (Electrically Erasable Programmable Read-Only Memory), which does not require any back-up battery for maintaining memory contents, is adopted in the IC memory card. For example, the IC memory card, which is disclosed in U.S. patent application No. 07/832,394 assigned to the same assignee as that of the present application, comprises a block erasing type of EEPROM which has a large capacity storage device in which stored is primary data such as image data and the like, as well as a byte-rewriting type of storage device in which stored is secondary data such as management information for the primary data. The latter type of storage device is adapted for rewriting data on a byte-by-byte basis. That IC memory card further comprises a control unit for controlling and managing those storage devices to store the data. The use of such a memory card makes it possible to provide a larger capacity of IC memory with lower cost than an IC memory card using an SRAM (Static Random Access Memory),for example. Further similar to the IC memory card using the SRAM, it is rendered possible to freely rewrite or up-date the supervisory data on a byte-by-byte basis.
An IC memory card control device, which controls recording and/or reading out various sorts of data in and/or from the above-mentioned IC memory card, is loaded into an electronic still camera, for example, so that information such as image or picture data obtained by means of photographing by this camera is recorded on the IC memory card which is detachably coupled with the memory card control apparatus. In this case, the IC memory card is obliged to store a great amount of picture data, and thus time required for recording will be elongated. Further, the IC memory card using the above-mentioned EEPROM needs a complicated control for data writing, different from the IC memory card using the SRAM. Hence, time required for data recording will become long. In view of these matters, the IC memory card using the EEPROM is provided with a predetermined storage capacity of a buffer, and is so arranged that data, which are transferred from the IC memory card control device and temporarily stored in the buffer, are read out therefrom under the control of the controller provided on the IC memory card and then written into a flushing type of EEPROM.
In the case where data are recorded on such an IC memory card, however, after completion of transfer of the data from the IC memory card control device to the IC memory card, the data is actually firstly stored in the buffer in the IC memory card. Thus, there are possibilities of occurrence of a so-called hot-line ejection such that the IC memory card is ejected from the IC memory card control device while data are being written into the EEPROM within the IC memory card from the buffer, and of turn-off of the power supply for the IC memory card control device during writing operation for data. In this case, the midway data have been written in a storage area of the IC memory card and thus incomplete data will remain therein. There is a problem such that the IC memory card control device, to which the IC memory card subjected to the hot-line ejection is connected later on, does not identify which data is incomplete data. For instance, there is a need such that image data recorded on the IC memory card are read out, and the read out image data are displayed on a CRT display unit so that a person estimates the quality of the image. In this instance, assuming the worst, if the IC memory card control device is used to read out the destroyed data, the device would stop the operation. Further, since the flushing type of EEPROM is not adapted to erase only optional data, the halfway written data would remain in such an area of the IC memory card as an unavailable area. Consequently, there is a problem such that the storage areas of the IC memory card cannot be efficiently used.
Further, now referring to the systems using the memory card as mentioned above, for example, a memory card management system for storing in a memory card picture data representative of an image captured together with supervisory data representative of the order of the storage and an indication of a storage area occupied is proposed by Japanese Patent Laid-Open Publication Nos. 286077/1988 and 193236/1990 in the name of the assignee of the present application. According to those memory card management systems, a memory card is provided with a storage area which is segmented into a plurality of clusters to manage the storage of data on an cluster-by-cluster basis. The relationship of ones of those clusters in which a field of image data is stored, for example, is defined by a memory allocation table (MAT) and a cluster in which the beginning portion of the field of image data is indicated on a directory. Management information on the management table called the MAT, the directory and the like is first read out when picture data is recorded with an electronic still camera for example, so that storage locations for picture data to be newly stored in the memory card are determined, and in addition the associated management information is produced and recorded onto the memory card.
It has been customary with a memory card for such an application as to implement the semiconductor memory in the form of an SRAM which promotes rapid data reading and writing operations. However, since an SRAM is a volatile semiconductor memory, a memory card with an SRAM needs a back-up battery for preventing data from disappearing. Another problem is that an SRAM capable of storing a great amount of data such as picture data is expensive, increasing the overall cost of an IC memory card implemented thereby. In light of the above, an EEPROM, which is nonvolatile so as not to require a back-up battery and is inexpensive, is now adopted in an IC memory card.
The EEPROM is capable of holding data therein for more than ten years without a battery. Some advanced EEPROMs are comparable with an SRAM in respect to the reading and writing rates and are as inexpensive as about one-fourth of SRAMs. According to the EEPROM, a rewriting operation for data needs three steps, including the first step in which the previously written data is erased, the second step in which new data is written, and the third step in which it is verified whether the new data has been exactly written. EEPROMs are generally classified into two types. One is the type of EEPROM in which all data or a single page, sector or similar block of data stored is erased or flushed at a time, which is called the flushing type. The other is the type of EEPROM in which data stored is erased byte by byte.
However, since the memory card using those EEPROMs are provided with a large number of steps comparing with the SRAMs, it is difficult for the host end to completely grasp their processings. Thus, if the memory card is erroneously ejected from the utility equipment in the mid course of processing in the card, or if the power supply to the system is suddenly turned off owing to power consumption of the battery or any other causes, the host end cannot, after the equipment is revived, identify which ones of the whole processings have been completed in the card, whereby it is difficult to perform a reliable processing operation. In this case, there often happens a great difference between a memory management area and a state of data actually written, and there is a danger such that the halfway written data area may be estimated as a defective area. As a result, even if the later writing is normally carried out, it is difficult to satisfactorily restore the area concerned at the time of power turned off or hot-line ejection, and thus there is a fear of occurrence of such a problem that the equipment stops in its operation. Specifically, in the case where the card is ejected during an operation for writing of data on the management area, even if the data are normally written, it is impossible to develop the contents of the card, since management information for managing such data is not satisfactorily renewed. In the worst case, there is a danger such that the memory card concerned cannot be used thereafter. Further, if it is intended to erase only a field of image data determined defective, another data which is not intended may be erased in accordance with an erroneous MAT. Thus, the conventional system has been associated with such a drawback that other data are destroyed.